package collection

func KeyBy(array []T, iteratee func(value T) V) map[V]T {
	ret := map[V]T{}
	for _, value := range array {
		v := iteratee(value)
		ret[v] = value
	}
	return ret
}
